Repository navigation
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR Summary by QodoKeep query strings out of HTTP request logs
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can choose which labels appear on a finding, and whether they show icons or text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Every HTTP request is logged with its full URI. API calls that change settings carry secrets in the query string, for example
/api/onvif?auth_pass=...and/api/rtsp?auth_pass=..., so passwords end up in the console output and in any log file or log collector that captures it.Why
parse_request()(src/server.c) printsNew request: (GET) <uri>and only afterwards splits the query off the URI (strchr(req->uri, '?')), so the log line contains everything.What this changes
The query is split off first and the log line shows the path followed by
?...when a query was present (/api/onvif?...). Nothing else in request handling changes:req->uriandreq->queryhold the same values as before when the handlers run.How it was checked
./build.sh fhan-v2, no new warnings...in the URI that follows it, and everything after, sees the same strings.Effect on other platforms
Shared web server code, compiled for all targets; only the text of one log line changes. No new headers or calls. The cost is some debugging convenience: the parameters of a call no longer appear in the log. If the maintainers want them for debugging, a build flag or
DEBUG_HTTPis a possible home.🤖 Generated with Claude Code